home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 9 / 009.d81 / resis color (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  137 lines

  1. 10 rem resistor color code
  2. 20 rem bob bader
  3. 30 rem new hampshire
  4. 40 rem 1984
  5. 100 poke53280,2:poke53281,0:print"[147]":printchr$(14)
  6. 110 print
  7. 120 printtab(9)"[144] [149]  [129] [158]   [156] [151]  "
  8. 130 printtab(9)"[144] [149]  [129] [158]   [156] [151]  "
  9. 140 poke646,7:print
  10. 150 print:printtab(10)"[210]esistor [195]olor [195]ode"
  11. 160 print:print:print:print
  12. 170 poke646,2
  13. 180 printtab(18)"by"
  14. 190 print:print:print
  15. 200 poke646,14
  16. 210 printtab(15)"[194]ob [194]ader"
  17. 220 print:print:print:print:print:print
  18. 230 poke646,3
  19. 240 printtab(4)"[196]o you need instructions ? ([217]/[206])"
  20. 250 poke198,0:wait198,1
  21. 260 geta$:ifa$="y"thengosub50000:goto270
  22. 265 ifa$<>"n"thengosub60000:goto250
  23. 270 print"[147]":print:poke646,3
  24. 280 input"1st [195]olor[158]";a$
  25. 281 iflen(a$)<3thengosub60010:goto280
  26. 285 poke646,3
  27. 290 print:input"2nd [195]olor[158]";b$
  28. 291 iflen(b$)<3thengosub60010:goto290
  29. 295 poke646,3
  30. 300 print:input"3rd [195]olor[158]";c$
  31. 301 iflen(c$)<3thengosub60010:goto300
  32. 302 a=0:b=0:c=0
  33. 400 ifa$="black"thena=0
  34. 410 ifa$="brown"thena=1
  35. 420 ifa$="red"thena=2
  36. 430 ifa$="orange"thena=3
  37. 440 ifa$="yellow"thena=4
  38. 450 ifa$="green"thena=5
  39. 460 ifa$="blue"thena=6
  40. 470 ifa$="violet"thena=7
  41. 480 ifa$="gray"thena=8
  42. 490 ifa$="white"thena=9
  43. 500 ifb$="black"thenb=0
  44. 510 ifb$="brown"thenb=1
  45. 520 ifb$="red"thenb=2
  46. 530 ifb$="orange"thenb=3
  47. 540 ifb$="yellow"thenb=4
  48. 550 ifb$="green"thenb=5
  49. 560 ifb$="blue"thenb=6
  50. 570 ifb$="violet"thenb=7
  51. 580 ifb$="gray"thenb=8
  52. 590 ifb$="white"thenb=9
  53. 600 ifc$="black"thenc=1
  54. 610 ifc$="brown"thenc = 10
  55. 620 ifc$="red"thenc = 100
  56. 630 ifc$="orange"thenc = 1000
  57. 640 ifc$="yellow"thenc = 10000
  58. 650 ifc$="green"thenc = 100000
  59. 660 ifc$="blue"thenc = 1000000
  60. 670 ifc$="violet"thenc = 10000000
  61. 680 ifc$="gray"thenc = 100000000
  62. 690 ifc$="white"thenc = 1000000000
  63. 691 ifa=0thenifa$<>"black"thengosub8000:goto240
  64. 692 ifb=0thenifb$<>"black"thengosub8000:goto240
  65. 693 ifc=0thengosub8000:goto240
  66. 700 z=((a*10)+b)*c
  67. 710 z$=str$(z)
  68. 720 iflen(z$)=2orlen(z$)=3orlen(z$)=4thengoto1000
  69. 730 iflen(z$)=5orlen(z$)=6orlen(z$)=7thengoto2000
  70. 740 iflen(z$)=7orlen(z$)=8orlen(z$)=9orlen(z$)=10thengoto3000
  71. 1000 print"[147]";:gosub5000
  72. 1010 poke646,10
  73. 1020 printtab(16)"[145][145][145]"z;"[207]hms"
  74. 1100 goto6000
  75. 2000 print"[147]";:gosub5000
  76. 2010 poke646,10
  77. 2020 printtab(14)"[145][145][145]"z/1000;"[203] [207]hms
  78. 2100 [137]6000
  79. 3000 [153]"load";:[141]5000
  80. 3010 [151]646,10
  81. 3020 [153][163]14)"ononon"z[173]10[174]6;"(NULL) (NULL)hms"
  82. 3100 [137]6000
  83. 5000 [153]:[153][163]9)"stop verify  for sys   clr poke  "
  84. 5001 [153][163]9)"stop verify  for sys   clr poke  "
  85. 5005 [153]:[153]:[153]:[153]:[153]:[153]:[153]
  86. 5010 [153][163]10)"********************"
  87. 5020 [153][163]10)"*                  *"
  88. 5030 [153][163]10)"*                  *"
  89. 5040 [153][163]10)"*                  *"
  90. 5060 [153][163]10)"********************"
  91. 5070 [142]
  92. 6000 [151]646,12
  93. 6010 [153]:[153]:[153]:[153]:[153]:[153]:[153]
  94. 6020 [153][163]3)"str$o you want to do another ? ((NULL)/(NULL))
  95. 6030 poke198,0:wait198,1
  96. 6040 geta$:ifa$="n"then7000
  97. 6050 ifa$<>"y"then6040
  98. 6060 goto270
  99. 7000 print"[147]":poke646,1:printchr$(142):goto63000
  100. 8000 print"[207]ne or more of the colors you entered"
  101. 8010 print:print"was not valid.  [208]lease try again.":print:return
  102. 50000 print"[147]";:poke646,1
  103. 50010 print:print
  104. 50100 print"[212]his program will give you the
  105. 50105 [153]
  106. 50110 [153]"resistance of a resistor by inputting
  107. 50115 print
  108. 50120 print"the colors of the resistor.
  109. 50200 [153]:[153]:[153]
  110. 50250 [153]"(NULL)ake sure (NULL)(NULL)(NULL) to use clrlenatn(NULL)right$(NULL)atn(NULL) "
  111. 50255 [153]
  112. 50260 [153]"letters when inputting the colors"
  113. 50270 [153]:[153]"and remember to spell the colors out."
  114. 50300 [153]:[153]:[153]:[153]:[153]
  115. 50350 [153][163]10)"sys(NULL)ress len to continue"
  116. 50360 [151]198,0:[146]198,1
  117. 50370 [161]a$:[139]a$[178]"c"[167][137]51000
  118. 50380 [139]a$[179][177]"c"[167][141]60000:[137]50360
  119. 51000 [153]"load":[153]
  120. 51010 [153]"(NULL)he way right$ remember the color code"
  121. 51020 [153]:[153]"is with the mnemonic:"
  122. 51030 [153]:[153]"peekatnstr$","black",0:[153]"verifypeek(NULL)(NULL)(NULL)","brown",1
  123. 51040 [153]"(NULL)(NULL)(NULL)","red",2:[153]"for(NULL)(NULL)","orange",3:[153]"sys(NULL)(NULL)(NULL)(NULL)","yellow",4
  124. 51050 [153]"chr$(NULL)atn(NULL)(NULL)","green",5:[153]"peekvalasc(NULL)(NULL)val","blue",6
  125. 51055 [153]"clr(NULL)right$(NULL)(NULL)val(NULL)(NULL)(NULL)(NULL)","violet",7:[153]"pokechr$val(NULL)(NULL)right$(NULL)chr$","gray",8
  126. 51060 [153]"(NULL)left$right$(NULL)(NULL)valstr$","white",9
  127. 52000 [153]:[153]:[153]:[153]:[153]
  128. 52010 [153][163]10)"sys(NULL)ress len to continue"
  129. 52020 [151]198,0:[146]198,1
  130. 52030 [161]a$:[139]a$[178]"c"[167][142]
  131. 52040 [139]a$[179][177]"c"[167][141]60000:[137]52020
  132. 60000 [151]53280,[187](1)[172]15:[151]53280,2:[142]
  133. 60010 [153]"(NULL)ou must spell out the word.":[142]
  134. 63000 [143]    connect back to l.s.
  135. 63002 [153]"loadload"[199](34)"payload"[199](34)",8":[153]"run"
  136. 63004 [151]198,0:[151]631,13:[151]632,13:[151]198,2:[128]
  137.